package com.glsc.ngateway.common.base.domainmapper;

import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.it.networkassets.NetworkAssetMaintenance;
import com.glsc.ngateway.common.api.platform.dto.it.networkassets.NetworkAssetMaintenanceDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;


/**
 * @Author: xc
 * @Date: 2023/03/16
 * @Desc: domin到dto转换辅助类
 */
@Mapper(componentModel = "spring")
public interface NetworkAssetMaintenanceMapper {
    NetworkAssetMaintenanceMapper INSTANCE = Mappers.getMapper(NetworkAssetMaintenanceMapper.class);

    @Mapping(target = "maintenanceInfoList", ignore = true)
    NetworkAssetMaintenanceDto domain2dto(NetworkAssetMaintenance domain);

    List<NetworkAssetMaintenanceDto> domain2dto(List<NetworkAssetMaintenance> domain);

    //写入时，关联list不做处理
    @Mapping(target = "insertTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "deleted", ignore = true)
    NetworkAssetMaintenance dto2domain(NetworkAssetMaintenanceDto dto);

    List<NetworkAssetMaintenance> dto2domain(List<NetworkAssetMaintenanceDto> dto);
}
